-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(root): a slightly more concise definition borrowed from Angular #2593
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so we're not throwing anymore if root is not resolvable?
I'm not sure there is a situation where root isn't resolvable, honestly. That was just some defensive coding. I'm indifferent, I'll leave it to the community. |
I wouldn't expect this occurs in usual cases, but there were few exceptional cases patching globals around could be caught by thrown exception. So for me it's good to have, it allowed us to identify some unexpected behavior comes from it. |
src/util/root.ts
Outdated
const _root: any = __window || __global || __self; | ||
|
||
if (!_root) { | ||
throw new Error('No window, global or root reference found'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess throw should be wrapped in IIFE as previous for closure compiler compatibility?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah.. changed it to match what used to be there exactly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description:
Related issue (if exists):